package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:05:07
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SysMessageBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id", com.ourteam.system.dao.ISysMessageDAO.Id);

        mappedDaoFields.put("parentId",
            com.ourteam.system.dao.ISysMessageDAO.ParentId);

        mappedDaoFields.put("senderId",
            com.ourteam.system.dao.ISysMessageDAO.SenderId);

        mappedDaoFields.put("title", com.ourteam.system.dao.ISysMessageDAO.Title);

        mappedDaoFields.put("content",
            com.ourteam.system.dao.ISysMessageDAO.Content);

        mappedDaoFields.put("priority",
            com.ourteam.system.dao.ISysMessageDAO.Priority);

        mappedDaoFields.put("sendTime",
            com.ourteam.system.dao.ISysMessageDAO.SendTime);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysMessageDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysMessageDAO.Remarks);

        mappedDaoFields.put("senderName",
            com.ourteam.system.dao.ISysMessageDAO.SenderName);

        mappedDaoFields.put("senderAccount",
            com.ourteam.system.dao.ISysMessageDAO.SenderAccount);
    }

    private com.ourteam.system.dao.SysMessage sysMessage;

    public SysMessageBean() {
        super();

        this.sysMessage = new com.ourteam.system.dao.SysMessage();
    }

    public SysMessageBean(com.ourteam.system.dao.SysMessage sysMessage) {
        super();

        this.sysMessage = sysMessage;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysMessage);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysMessage convertToSysMessage() {
        return this.sysMessage;
    }

    public com.ourteam.system.dao.SysMessage convertTo() {
        return this.sysMessage;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysMessage.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysMessage.setId(id);
    }

    /**
     * Get parentId
     *
     * @return long
     */
    public long getParentId() {
        return (long) this.sysMessage.getParentId();
    }

    /**
     * Set parentId
     *
     * @parameter long
     */
    public void setParentId(long parentId) {
        this.sysMessage.setParentId(parentId);
    }

    /**
     * Get senderId
     *
     * @return long
     */
    public long getSenderId() {
        return (long) this.sysMessage.getSenderId();
    }

    /**
     * Set senderId
     *
     * @parameter long
     */
    public void setSenderId(long senderId) {
        this.sysMessage.setSenderId(senderId);
    }

    /**
     * Get title
     *
     * @return String
     */
    public String getTitle() {
        return (String) this.sysMessage.getTitle();
    }

    /**
     * Set title
     *
     * @parameter String
     */
    public void setTitle(String title) {
        this.sysMessage.setTitle(title);
    }

    /**
     * Get content
     *
     * @return String
     */
    public String getContent() {
        return (String) this.sysMessage.getContent();
    }

    /**
     * Set content
     *
     * @parameter String
     */
    public void setContent(String content) {
        this.sysMessage.setContent(content);
    }

    /**
     * Get priority
     *
     * @return String
     */
    public String getPriority() {
        return (String) this.sysMessage.getPriority();
    }

    /**
     * Set priority
     *
     * @parameter String
     */
    public void setPriority(String priority) {
        this.sysMessage.setPriority(priority);
    }

    /**
     * Get sendTime
     *
     * @return java.util.Date
     */
    public java.util.Date getSendTime() {
        return (java.util.Date) this.sysMessage.getSendTime();
    }

    /**
     * Set sendTime
     *
     * @parameter java.util.Date
     */
    public void setSendTime(java.util.Date sendTime) {
        this.sysMessage.setSendTime(sendTime);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysMessage.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysMessage.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysMessage.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysMessage.setRemarks(remarks);
    }

    /**
     * Get senderName
     *
     * @return String
     */
    public String getSenderName() {
        return (String) this.sysMessage.getSenderName();
    }

    /**
     * Get senderAccount
     *
     * @return String
     */
    public String getSenderAccount() {
        return (String) this.sysMessage.getSenderAccount();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SysMessageBean) == false) {
            return false;
        } // end if

        SysMessageBean other = (SysMessageBean) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysMessage tempSysMessage = other.convertToSysMessage();

        if ((tempSysMessage == null) || (this.sysMessage == null)) {
            isEqual = false;
        } else if ((tempSysMessage == this.sysMessage) ||
                tempSysMessage.equals(this.sysMessage)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SysMessageBean[] toArray(
        com.ourteam.system.dao.SysMessage[] aSysMessages) {
        return toArray(aSysMessages, null);
    }

    public static SysMessageBean[] toArray(
        com.ourteam.system.dao.SysMessage[] aSysMessages,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysMessages)) {
            return new SysMessageBean[0];
        }

        int length = aSysMessages.length;

        SysMessageBean[] beans = new SysMessageBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SysMessageBean(aSysMessages[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i], new Object[] { aSysMessages[i] });
            }
        }

        return beans;
    }
}
